<template>
  <div id="app">
    <nav class="navbar  navbar-default">
      <div class="myContainer">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expended="true" aria-controls="navbar">
            <span class="sr-only">综合素质评价</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#/login">综合素质评价</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav" v-show="studentNo != -1 ">
            <!--//导员-->
            <li class="nav-item" v-show="identity == 0">
              <a class="nav-link" href="#/counselor">主页</a>
            </li>
            <li class="nav-item" v-show="identity == 0">
              <a class="nav-link" href="#/scienceCheck">发展性综合素质测评审核</a>
            </li>
            <li class="nav-item" v-show="identity == 0">
              <a class="nav-link" href="#/documentaryCheck">记实项目审核</a>
            </li>
            <li class="nav-item" v-show="identity == 0">
              <a class="nav-link" href="#/lifeTeacherMutual">小组成员测评</a>
            </li>

            <!--//班主任-->
            <li class="nav-item" v-show="identity == 1">
              <a class="nav-link" href="#/headerteacherIndex">主页</a>
            </li>
            <li class="nav-item" v-show="identity == 1">
              <a class="nav-link" href="#/mutual">小组成员测评</a>
            </li>

            <!--//班长加学生-->
            <li class="nav-item" v-show="identity != 1 && identity != 0">
              <a class="nav-link" v-bind:href="stuIndex">主页</a>
            </li>
            <li class="nav-item" v-show="identity != 1 && identity != 0">
              <a class="nav-link" href="#/mutual">班级互评</a>
            </li>
            <li class="nav-item" v-show="identity != 1 && identity != 0">
              <a class="nav-link" href="#/scienceCommit">发展性素质测评</a>
            </li>
            <li class="nav-item" v-show="identity != 1 && identity != 0">
              <a class="nav-link" href="#/pubDocumentary">记实信息公开</a>
            </li>
            <li class="nav-item" v-show="identity == 2">
             <a class="nav-link" href="#/documentaryCommit">记实项目提交</a>
            </li>
            <li class="nav-item" v-show="identity == 2">
              <a class="nav-link" href="#/scienceCheck">发展性素质测评审核</a>
            </li>
            <li class="nav-item" v-show="identity == 2">
              <a class="nav-link" href="#/documentaryCheck">记实项目审核</a>
            </li>
          </ul>
        </div>
      </div>
    </nav>
    <router-view></router-view>
    <div class="foot"><hr>
      <p class="text-center"><small><a href="https://github.com/orgs/upcyiban/">@UPC-YIBAN</a></small></p>
    </div>
  </div>
</template>
<script>
  import { decodeData } from './config/base64'
  export default {
  name: 'app',
  data() {
      return{
        stuIndex:"#/grade/",
        studentNo: '',
        identity:''
      }

  },
  mounted(){
    setTimeout(()=>{
      this.studentNo = decodeData(localStorage.getItem('studentNo'))
      this.stuIndex = this.stuIndex + this.studentNo
      this.identity = decodeData(localStorage.getItem('identity'))
    },1000)
  }

}
</script>

<style>
  @import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  width: 80%;
  margin: 0 auto;
}
  .myContainer{
    width: 100%;
  }
.foot{
  position: fixed;
  bottom: 0;
  right: 20%;
}
  a {
    background-color: #F8F8F9 ;
  }
li{
  background-color: #F8F8F9 ;
}
</style>
